﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using BloomFilter;

namespace WebCollection
{
    class UrlFilter
    {
        public Filter<string> BloomFilter = new Filter<string>(3000000, 0.001F);


        //本地序列化与发序列化的代码



        /// <summary>
        ///如果有 返回true 如果没有 返回 false
        /// </summary>
        public bool ContainUrl(string url)
        {
            if (BloomFilter.Contains(url))
            {
                return true;
            }
            BloomFilter.Add(url);
            return false;
        }

        
    }
}
